$(function (){
    $("#sendBtn").click(send_letter);
});

function send_letter(){
    var toName = $("#target-name").val();
    var content = $("#message-text").val();
    let CONTEXT_PATH = "localhost:8080/kunbo";
    $.post(
        CONTEXT_PATH + "/vip/send",
        {"toName":toName,"content":content},
        function (data){
            data = $.parseJSON(data);
            if(data.status == "0"){
                $("#hintBody").text("发送成功");
            }else {
                $("#hintBody").text("发送失败");
            }
            $("#hintModal").model("show");
            setTimeout(function (){
               $("#hintModal").modal("hide");
               location.reload();
            }, 2000);
        }
    );
    alert(123);

}

